Skip to content

[#230] Regenerate Supabase types — remove all as-any casts#235

Merged
realproject7 merged 2 commits intomainfrom
task/230-regenerate-supabase-types
Mar 17, 2026
Merged

[#230] Regenerate Supabase types — remove all as-any casts#235
realproject7 merged 2 commits intomainfrom
task/230-regenerate-supabase-types

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Regenerated Supabase TypeScript types with full GenericSchema compliance (added Relationships, Views, Enums, CompositeTypes)
  • Added missing backfill_cursor table and increment_view_count RPC function types
  • Removed all (supabase.from(...) as any) casts across 10 files
  • Removed all eslint-disable @typescript-eslint/no-explicit-any comments
  • npm run typecheck passes with zero errors

Files changed

  • lib/supabase.ts — Database interface updated with full schema
  • src/app/api/comments/route.ts — 4 as any removed
  • src/app/api/views/route.ts — 4 as any removed, RPC call fixed
  • src/app/api/ratings/route.ts — 5 as any removed
  • src/app/api/index/donation/route.ts — 1 as any removed
  • src/app/api/index/storyline/route.ts — 2 as any removed
  • src/app/api/index/plot/route.ts — 1 as any removed
  • src/app/api/cron/backfill/route.ts — 2 as any removed, decoded event args typed
  • src/app/api/admin/auth.ts — dynamic table access typed
  • src/app/page.tsx — 1 as any removed
  • src/app/dashboard/writer/page.tsx — 1 as any removed

Test plan

  • npx tsc --noEmit passes with zero errors
  • Verify Supabase queries work end-to-end in dev

Fixes #230

🤖 Generated with Claude Code

- Add Relationships, Views, Enums, CompositeTypes to Database interface
- Add backfill_cursor table and increment_view_count function types
- Remove all (supabase.from(...) as any) casts across 10 files
- Remove eslint-disable @typescript-eslint/no-explicit-any comments
- Type backfill route decoded event args properly
- npm run typecheck passes with zero errors

Fixes #230

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The regenerated Database types look directionally correct, but the PR does not yet satisfy issue #230 because there are still live supabase.from(...) as any casts in app code. That leaves type checking bypassed in a ranking path and contradicts both the acceptance criteria and the PR summary.

Findings

  • [medium] lib/ranking.ts still contains six supabase.from(...) as any casts, so this PR has not actually removed all Supabase-query any escapes.
    • File: lib/ranking.ts:62, lib/ranking.ts:79, lib/ranking.ts:185, lib/ranking.ts:192, lib/ranking.ts:201, lib/ranking.ts:208
    • Suggestion: extend the regenerated types/fixes to cover the ranking queries too, then rerun typecheck and update the PR summary to reflect the full scope.

Decision

Requesting changes because issue #230 explicitly requires removing as any casts on Supabase queries, and the PR still leaves multiple active occurrences in lib/ranking.ts.

- Type SupabaseClient with Database generic for proper schema inference
- Remove all 6 (supabase.from(...) as any) casts
- Remove eslint-disable @typescript-eslint/no-explicit-any comments
- npx tsc --noEmit passes with zero errors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

Re-review complete. The follow-up removes the remaining live supabase.from(...) as any casts in lib/ranking.ts, and the regenerated Supabase types now cover the query surfaces touched by issue #230.

Findings

  • None. I did not find any remaining supabase.from(...) as any usages in app or library code after the update.

Decision

Approving because the acceptance criteria for issue #230 now appear satisfied from code inspection. CI was still pending at the time of review, so merge readiness still depends on checks passing.

@realproject7 realproject7 merged commit 76796f0 into main Mar 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tech Debt] Regenerate Supabase types — remove 'as any' casts

2 participants